﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Legazpi.Payroll.Web.Models.Reports;
using Legazpi.Payroll.BusinessLogic.Services;

namespace Legazpi.Payroll.Web.Utils
{
    public class ReportHelper
    {
        public IQueryable<EmployeeReportModel> GetEmployees()
        {
            var _employeeService = new EmployeeService();
            return _employeeService.GetAll().Select(x =>
                    new EmployeeReportModel { 
                        EmployeeName = x.FirstName,
                        Code = x.EmployeeCode,
                        DateHired = string.Empty,
                        PagibigId = x.PagIbigId,
                        TIN = x.TinId,
                        PhilhealthId = x.PhilHealthId,
                        Position = x.Position.Code,
                        Status = "Active",                         
                    }).AsQueryable<EmployeeReportModel>();
        }

        public IQueryable<PayslipModel> GetEmployeePayslips()
        {
            var testList = new List<PayslipModel>();
            testList.Add(new PayslipModel
            {
                EmployeeName = "Emmanuel De Jesus",
                Code = "123-456",
                Position = "Programmer"
            });
            testList.Add(new PayslipModel
            {
                EmployeeName = "Emmanuel De Jesus2",
                Code = "123-456",
                Position = "Programmer"
            });
            return testList.AsQueryable<PayslipModel>();
        }
    }
}